/**
 * Created by MADHUKAR on 1/10/2015.
 */
//global scope
var count = 20;

total = 25;
function sum(){

    //function scope
    //var count = 10;
    //count -- 11
    total = 20;
    final = 20;

    return count++;
}

//window.total

//++count

sum();
//total --after line 18 value of total//  -- undefined
// error
//20


//outer count and what does the function returns

//sum -- 11, count -- 20--wrong

// sum -- 10, count -- 20 -- right
// sum --  20, count -- 21
